Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Determining Vector Cross Products

QuickDraw 3D provides routines that you can use to calculate cross products of vectors.

Q3Vector2D_Cross

You can use the Q3Vector2D_Cross function to determine the cross product of two two-dimensional vectors.

float Q3Vector2D_Cross (
                     const TQ3Vector2D *v1,
                     const TQ3Vector2D *v2);
v1
A two-dimensional vector.
v2
A two-dimensional vector.

DESCRIPTION

The Q3Vector2D_Cross function returns, as its function result, the cross product of the vectors v1 and v2 .

Q3Vector3D_Cross

You can use the Q3Vector3D_Cross function to determine the cross product of two three-dimensional vectors.

TQ3Vector3D *Q3Vector3D_Cross (
                     const TQ3Vector3D *v1,
                     const TQ3Vector3D *v2,
                     TQ3Vector3D *result);
v1
A three-dimensional vector.
v2
A three-dimensional vector.
result
On exit, the cross product of v1 and v2 .

DESCRIPTION

The Q3Vector3D_Cross function returns, as its function result and in the result parameter, the cross product of the vectors v1 and v2 .

Q3Point3D_CrossProductTri

You can use the Q3Point3D_CrossProductTri function to determine the cross product of the two vectors defined by three three-dimensional points.

TQ3Vector3D *Q3Point3D_CrossProductTri (
                     const TQ3Point3D *point1,
                     const TQ3Point3D *point2,
                     const TQ3Point3D *point3,
                     TQ3Vector3D *crossVector);
point1
A three-dimensional point.
point2
A three-dimensional point.
point3
A three-dimensional point.
crossVector
On exit, the cross product of the two vectors determined by subtracting point2 from point1 and point3 from point1 .

DESCRIPTION

The Q3Point3D_CrossProductTri function returns, as its function result and in the crossVector parameter, the cross product of the two vectors determined by subtracting point2 from point1 and point3 from point2 .


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |